<h1>Runs</h1>

<p>
<h3><%= link_to 'Results', results_path %></h3>
<p>

<table border>
  <tr>
    <th>     
      <font size="2">Mu IP</font>
      <font size="1"><%= link_to( '^', runs_path( :order => :mu_ip, :direction => 'asc' ) ) %></font>
      <font size="1"> <%= link_to( 'v', runs_path( :order => :mu_ip, :direction => 'desc' ) ) %></font>
    </th>
    <th>      
      <font size="2">Run ID</font>
      <font size="1"><%= link_to( '^', runs_path( :order => :id, :direction => 'asc' ) ) %></font>
      <font size="1"><%= link_to( 'v', runs_path( :order => :id, :direction => 'desc' ) ) %></font>
    </th>
    <th>    
      <font size="2">Host Names</font>
      <font size="1"><%= link_to( '^', runs_path( :order => :host_names, :direction => 'asc' ) ) %></font>
      <font size="1"><%= link_to( 'v', runs_path( :order => :host_names, :direction => 'desc' ) ) %></font>
    </th>
    <th>      
      <font size="2">Host Roles</font>
      <font size="1"><%= link_to( '^', runs_path( :order => :host_roles, :direction => 'asc' ) ) %></font>
      <font size="1"><%= link_to( 'v', runs_path( :order => :host_roles, :direction => 'desc' ) ) %></font>
    </th>
    <th>  
      <font size="2">Scenario</font>
      <font size="1"><%= link_to( '^', runs_path( :order => :scenario_name, :direction => 'asc' ) ) %></font>
      <font size="1"><%= link_to( 'v', runs_path( :order => :scenario_name, :direction => 'desc' ) ) %></font>
    </th>
    <th>    
      <font size="2">Testsuite</font>
      <font size="1"><%= link_to( '^', runs_path( :order => :testsuite_name, :direction => 'asc' ) ) %></font>
      <font size="1"><%= link_to( 'v', runs_path( :order => :testsuite_name, :direction => 'desc' ) ) %></font>
    </th>
    <th>Show</th> 
    <th>Execute</th>
    <th>Edit</th> 
    <th>Results</th>
    <th>Delete</th>
  </tr>

<% @runs.each do |run| %>
<tr valign="top" class= "<%= cycle('list-line-odd', 'list-line-even') %>">
    <td><%=h run.mu_ip %></td>
    <td><%=h run.id %></td>
    <td><%=h run.host_names %></td>
    <td><%=h run.host_roles %></td>
    <td><%=h run.scenario_name %></td>
    <td><%=h run.testsuite_name %></td>
    <td><%= link_to 'Show', run %></td> 
    <td><%= link_to 'Execute', :controller => "runs", :run => run, :execute => "true" %> </td>
    <td><%= link_to 'Edit', edit_run_path(run) %></td> 
    <td><%= link_to 'Results', :controller => "results", :run_id => run %> </td>
    <td><%= link_to 'Delete', run, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>


<div />
<br />
1) <font size="2">Change a MU IP</font>&nbsp;&nbsp (current: <font size="3"><b><%=h $mu_ip %></b></font>)
  <form action="/runs" class="get_templates" id="new_run" method="post">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label for="get_mu_ip">new Mu IP</label> &nbsp;
    <input id="get_mu_ip" name="run[mu_ip]" size="12" type="text"/>
    &nbsp; <input id="run_submit" name="commit" type="submit" value="Set IP" />
  </form>

<p />
2) Create a New Test Run from a Scenario and Test Suite (then select Edit to set Hosts)
<br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%= link_to 'New Test Run', new_run_path %>
<p />
3) Set the Hosts for the Test Run
<br />&nbsp;&nbsp;&nbsp;&nbsp; select 'Edit' from the table above
<p />
4) Execute the Test Run
<br />&nbsp;&nbsp;&nbsp;&nbsp; select 'Execute' from the table above
<p />
<p />
opt) Clear templates to start over from a different Mu
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%= link_to 'Clear Templates', :controller => "runs", :clear_templates => "true" %>
